# Maintainer: Eivind Uggedal <eu@eju.no>
pkgname=py3-hiredis
_pkgname=${pkgname#py3-}
pkgver=1.0.1
pkgrel=0
pkgdesc="Python extension that wraps hiredis"
url="https://github.com/redis/hiredis-py"
arch="all"
license="BSD-3-Clause"
makedepends="python3-dev py3-setuptools hiredis-dev"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	system-hiredis.patch
	hiredis-0.14-compat.patch"

# keep these til after alpine v3.11
provides="py-$_pkgname=$pkgver-r$pkgrel"  # for backward compatibility
replaces="py-$_pkgname"  # for backward compatibility

builddir="$srcdir"/$_pkgname-$pkgver

build() {
	python3 setup.py build
}

check() {
	python3 test.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="8aa5e29b09f42826d746857d55b8042b40ffa3977386b0f8b2ea1b2ede0c28337f3df4bbd177192d8873570810bc9d0987f1f2b29f094f27adaa4aaf409c3a6b  hiredis-1.0.1.tar.gz
4be1599851215547b4b994a966087024cc86b495dbfdcb9807dabcffb5505509f25398c55a07b2a8fb7221cf9c5d27738a38f8c87fe2e37d991a2de3cfa38451  system-hiredis.patch
a066ceab985be6ae87f0c30b98a496e6929909ac5d94b21fac9544bc8f649b0c1f0b66760441a90dc8bc50f4d748775f3d3a042fe8a4b466b5371bfb49b16f7a  hiredis-0.14-compat.patch"
